<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the id=main div and all content
 * after.  Calls sidebar-footer.php for bottom widgets.
 *
 * @package WordPress
 * @subpackage Master Theme
 */
?>
        </div><!-- #main -->
    </div><!-- #main_wrapper -->
	
    <div id="footer_wrapper">
        <div id="footer" role="contentinfo">
        
            <div id="colophon">
                <?php
                    /* A sidebar in the footer? Yep. You can can customize
                     * your footer with four columns of widgets.
                     */
                    get_sidebar( 'footer' );
                ?>
            </div><!-- #colophon -->
        
            <div id="footer_info">
                <p>
                &copy; <?php echo date('Y'); ?> <a href="<?php echo site_url(); ?>" rel="author">[trudocs]</a>
                </p>
            </div>
            
        </div><!-- #footer -->
    </div><!-- #footer_wrapper -->

	<?php // DEV AREA
    
        // SHOW THE DEV NOTES FORM
            if ( is_god() && is_page()  ){
				
                // GET AND DISPLAY DEV NOTE
					global $post;
					$ID = get_post( $post )->ID;
                    $devPagePriority = get_post_meta( $ID, 'devPagePriority', true );
                    $devBugsPriority = get_post_meta( $ID, 'devBugsPriority', true );
                    $devModsPriority = get_post_meta( $ID, 'devModsPriority', true );
                    $devAdtlPriority = get_post_meta( $ID, 'devAdtlPriority', true );
                    $devNotesBugs = get_post_meta( $ID, 'devNotesBugs', true );
                    $devNotesMods = get_post_meta( $ID, 'devNotesMods', true );
                    $devNotesAdtl = get_post_meta( $ID, 'devNotesAdtl', true );
                ?>
                <div id="devNotes">
                    <form name="devNotesForm" id="devNotesForm" action="" enctype="multipart/form-data" method="POST">
                        <?php //wp_nonce_field( 'wpuf-edit-post' ); // SET NONCE FOR SECURITY ?>
                        <h1 class="page-title">Development Notes</h1>
                        <hr />
                        <label for="devPagePriority">Page priority:</label> <input type="text" name="devPagePriority" id="devPagePriority" value="<?php echo $devPagePriority; ?>" /><br />
                        <hr />
                        <div class="devNoteField">
                            <h3>Technical errors, user-flow flaws or display errors found on this page...</h3>
                            <label for="devBugsPriority">Priority:</label> <input type="text" name="devBugsPriority" id="devBugsPriority" value="<?php echo $devBugsPriority; ?>" /><br />
                            <label for="devNotesBugs">Error/Bug Reports:</label><br />
                            <textarea name="devNotesBugs" id="devNotesBugs"><?php echo $devNotesBugs; ?></textarea><br />
                        </div>
                        <div class="devNoteField">
                            <h3>Modifications needed to existing elements on this page...</h3>
                            <label for="devModsPriority">Priority:</label> <input type="text" name="devModsPriority" id="devModsPriority" value="<?php echo $devModsPriority; ?>" /><br />
                            <label for="devNotesMods">Modifications:</label><br />
                            <textarea name="devNotesMods" id="devNotesMods"><?php echo $devNotesMods; ?></textarea><br />
                        </div>
                        <div style="clear:both"></div>
                        <div class="devNoteField">
                            <h3>Additional elements for needed for this page...</h3>
                            <label for="devAdtlPriority">Priority:</label> <input type="text" name="devAdtlPriority" id="devAdtlPriority" value="<?php echo $devAdtlPriority; ?>" /><br />
                            <label for="devNotesAdtl">Additional:</label><br />
                            <textarea name="devNotesAdtl" id="devNotesAdtl"><?php echo $devNotesAdtl; ?></textarea><br />
                         </div>
                        <hr />
                         <input id="devNotesPID" name="devNotesPID" type="hidden" value="<?php echo $ID; ?>" />
                         <input id="devNotesSubmit" name="devNotesSubmit" type="submit" />Save</input>
                        <hr />
                    </form>
                    <div style="clear:both"></div>
                </div>
                
            <?php } // END OF DEV NOTES FORM
            
         // SAVE THE DEV NOTES FORM
            if(isset($_POST['devNotesSubmit'])) {
                $devID = $_POST['devNotesPID'];
                $devPagePriority = $_POST['devPagePriority'];
                $devBugsPriority = $_POST['devBugsPriority'];
                $devModsPriority = $_POST['devModsPriority'];
                $devAdtlPriority = $_POST['devAdtlPriority'];
                $devNotesBugs = $_POST['devNotesBugs'];
                $devNotesMods = $_POST['devNotesMods'];
                $devNotesAdtl = $_POST['devNotesAdtl'];
                update_post_meta( $devID, 'devPagePriority', $devPagePriority );
                update_post_meta( $devID, 'devBugsPriority', $devBugsPriority );
                update_post_meta( $devID, 'devModsPriority', $devModsPriority );
                update_post_meta( $devID, 'devAdtlPriority', $devAdtlPriority );
                update_post_meta( $devID, 'devNotesBugs', $devNotesBugs );
                update_post_meta( $devID, 'devNotesMods', $devNotesMods );
                update_post_meta( $devID, 'devNotesAdtl', $devNotesAdtl );
            }
        
    // END DEV AREA ?>

    <?php
        /* Always have wp_footer() just before the closing </body>
         * tag of your theme, or you will break many plugins, which
         * generally use this hook to reference JavaScript files.
         */
        wp_footer();
    ?>
    
</body>
</html>
